export const exportTable = (table, fileName) => {
  const html = `<html><head><meta charset='utf-8' /></head><body>${table}</body></html>`;
  const aTag = document.createElement('a');
  const blob = new Blob([html], { type: 'application/vnd.ms-excel' });
  aTag.download = `${ fileName ?fileName:new Date().getTime()}.xls`;
  aTag.href = URL.createObjectURL(blob);
  aTag.click();
  URL.revokeObjectURL(blob);
};


export const renderTable = (header, columns) => {
  const tableHeader = header.map(item => {
    return <th>Email</th>
  })

  <tbody>
    <tr>
      <td>John</td>
      <td>Doe</td>
      <td>john@example.com</td>
    </tr>
    <tr>
      <td>Mary</td>
      <td>Moe</td>
      <td>mary@example.com</td>
    </tr>
    <tr>
      <td>July</td>
      <td>Dooley</td>
      <td>july@example.com</td>
    </tr>
  </tbody>
</table>
}
